<?php
/*
*
* BEGIN teams.php
*
*
* Dazzler Presenter - Teams Page
* @Description: Presents the teams page
* @Authors: Salman Noor, Wits University
* @Copyright: © Wits University 2011 - All Rights Reserved
* @License: BSD License (http://www.linfo.org/bsdlicense.html)
*
*
* BEGIN CHANGELOG
* Developers working on thee files are REQUIRED to maintain this CHANGELOG.
* Please ensure you follow the Changelog Guidelines: http://code.google.com/p/dazzler/wiki/DazzlerDevelopGuideline?ts=1315476570&updated=DazzlerDevelopGuideline
* !==================================================================================================================================================================
*
* VERSION 1.0.0
*	+ Created, Salman, 22 September 2011
*
* ==================================================================================================================================================================!
* END CHANGELOG
*/


/*******************************************************************************************************************************************************************
*
* BEGIN Direct Call Check
*
/******************************************************************************************************************************************************************/
global $doNotCallThisScriptDirectly;
if ($doNotCallThisScriptDirectly != 1)
{
	/* Read the ini language file */
	$ini_lang_array = array();
	$clientlang = explode(",", strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
	$lang_ini_array = (file_exists("lang/" . trim($clientlang[0]) . ".ini")) ? parse_ini_file("lang/" . trim($clientlang[0]) . ".ini", true) : parse_ini_file("lang/en.ini", true);
	die ($lang_ini_array['ERRORS']['doNotCallThisScriptDirectly']);
}
/*******************************************************************************************************************************************************************
*
* END Direct Call Check
*
/******************************************************************************************************************************************************************/


/*******************************************************************************************************************************************************************
* BEGIN declare custom variables used in templates/terms.php
/******************************************************************************************************************************************************************/
	$css_head = "";
        $js_head = "";
        $footerString="";
        $leftColumnContent="";
        $mainContent="";
        $modalWindowContent="";

$parsesiteconfig = new parsesiteconfig();
$defaultWebTheme = $parsesiteconfig->getDefaultWebTheme();


        $css_head = $parsesiteconfig->getjQueryUICSSFilesForSetTheme();

        $cm = new fetchpathitems($path . "/sites/dazzler/themes/$loadType/custom/styles/commentator", "css");

	foreach($cm->cm as $includeCssFile)
	{
            $css_head .= "<link rel='stylesheet' type='text/css' href='$rootpath/themes/$loadType/custom/styles/commentator/$includeCssFile' />";
	}
        $UserLogic = new UserLogic();
        if($UserLogic->isUserCommentator())
        {
                $cm = new fetchpathitems($path . "/sites/dazzler/themes/$loadType/global/scripts", "js");

            foreach($cm->cm as $includeJsFile)
            {
                    $js_head .= "<script src='$rootpath/themes/$loadType/global/scripts/$includeJsFile'></script>\n";
            }

            $cm = new fetchpathitems($path . "/sites/dazzler/themes/$loadType/custom/scripts/commentator", "js");

            foreach($cm->cm as $includeJsFile)
            {
                    $js_head .= "<script src='$rootpath/themes/$loadType/custom/scripts/commentator/$includeJsFile'></script>\n";
            }

                    $cm = new fetchpathitems($path . "/sites/dazzler/themes/$loadType/custom/scripts/teams", "js");

            foreach($cm->cm as $includeJsFile)
            {
                    $js_head .= "<script src='$rootpath/themes/$loadType/custom/scripts/teams/$includeJsFile'></script>\n";
            }
        }
        else
        {
           $cm = new fetchpathitems($path . "/sites/dazzler/themes/$loadType/custom/scripts/cricketfan", "js");

            foreach($cm->cm as $includeJsFile)
            {
                    $js_head .= "<script src='$rootpath/themes/$loadType/custom/scripts/cricketfan/$includeJsFile'></script>\n";
            }
        }

	

        $user_management_ui = new user_management_ui;
//        $leftColumnContent = $user_management_ui->showWebLoginWindow();
//
        $modalWindowContent = "<div id='modalDialogWindow' title='Basic dialog'>
	<div id='modalWindowContent'></div>
</div>";

        $top_nav_content = new top_nav_content();
        $topNavContent = $top_nav_content->showMainTopNav();

        $side_nav_content = new side_nav_content();
        if($UserLogic->isUserCommentator())
        {
        $sideNavContent = $side_nav_content->showCommentatorSideNav();
        }
        else
        {
       $sideNavContent = $side_nav_content->showCricketFanSideNav();
        }
        $team_management_ui = new team_management_ui();
        $centerColumnContent = $team_management_ui->showTeamPage();
        $centerColumnContent .= $team_management_ui->showFeaturedTeamsList();
        $centerColumnContent .= "<div id='teamList'>".$team_management_ui->showListAllTeams()."</div>";
        $loadingImagePath = "$rootpath/themes/$loadType/global/images/loading.gif";
        $centerColumnContent .= "<input type='hidden' id='loadingImage' name='loading Image Path' value=$loadingImagePath />";
       // $center_column_content = new center_column_content();
      //  $centerColumnContent= $center_column_content->showTermsPageCenterColumnContent();

$headerLogo = "$rootpath/themes/$loadType/global/images/dazzler_logo.png";
include $path . "/sites/dazzler/themes/$loadType/templates/main.php";
/*******************************************************************************************************************************************************************
* END daclare content with main page
/******************************************************************************************************************************************************************/

/*
*
* END main.php
*
*/
?>
